1. Field of the Invention
The present invention relates to a ruled line extraction apparatus for extracting a ruled line from a multiple-valued image such as a gray scale image, a color image, etc., and pattern extraction apparatus for extracting an arbitrary pattern from a multiple-valued image.
2. Description of the Related Art
Recently, with an increasing number of input units such as scanners, etc., a larger number of images are processed in documents by computers, and a demand for an OCR (optical character reader) has outstandingly grown. The OCR is provided for a user as software or a character recognition device.
When an image input through an input unit is a gray scale image, it is necessary for the character recognition device to binarize the image in an appropriate method. Especially, when a non-contacting type image input device such as an OHR (overhead reader) is used, the resultant image frequently has uneven gray levels, dark, distortion, etc. as compared with the image obtained by a scanner. Therefore, it is necessary to appropriately binarize the image.
The conventional binarizing method refers to global binarization in which the entire image is binarized using the same threshold, and local binarization in which the image is binarized for each of local areas.
However, when a ruled line is extracted from a gray scale image in a document containing ruled lines such as a slip, etc., the above mentioned conventional binarizing method has the following problems.
In the global binarization, an image can have a dark portion, and therefore a binarization result may indicate a blur, an expansion, etc. of a pattern when the gray level of the image partially fluctuates, thereby failing in correctly extracting ruled lines.
Furthermore, in the local binarization, the influence of the dark portion can be reduced. However, since the binarizing process is performed on an area around a target pixel, there is the possibility that a ruled line is mis-recognized as a background when a thick character exists near a thin ruled line. Furthermore, the noise caused by uneven gray levels, etc. can be binarized and recognized as a black pattern, thereby disadvantageously affecting a ruled line extracting process.
In any of the above mentioned binarizing methods, a binarization result often indicates a blur, an expansion, etc. when there is little difference in gray level between a ruled line and its background, thereby failing in correctly performing a binarizing process.
Thus, the conventional global and local binarization cannot always obtain an acceptable binary image without a blur and an expansion. Therefore, when a ruled line extracting process is performed using an obtained binary image, a blur or an expansion possibly prevents the extracting process from being correctly performed.
In a slip, etc., a ruled line, a character, a pattern such as graphics, etc. written on the reverse side, and in a brochure, a pattern written on the next page can slightly be seen through paper. In this case, an input image can show the pattern from the reverse side or the next page. Therefore, an undesired reverse-side pattern can be extracted when a specified pattern is extracted from an input image.